<template>
	<view>
		<uni-popup :ref="sharePopName" type="bottom" :isMaskClick="false">
			<view class="share-area">
				<view class="share-content">
					<view class="share-item">
						<view><uni-icons type="weixin" size="40" color="#1aad19"></uni-icons></view>
						<view>分享到微信</view>
						<button open-type="share" class="share-btn">
		
						</button>
					</view>
				</view>
			</view>
			<view class="share-cancel-area">
				<button type="default" @click="cancelPop">取消</button>
			</view>
		</uni-popup>
	</view>
</template>

<script>
	export default {
		name:"sharePopup",
		props:{
			sharePopName:'sharePopup',
		},
		data() {
			return {
				shareShop:{}
			};
		},
		onShareAppMessage(res) {
			let reqObject = {
				title: config.appInfo.name,
				path: '/pages/index/index',
				imageUrl: '/static/logo.png',
			}
			if (res.from == 'button') {
				let shopId = this.shareShop.id
				reqObject.title = this.shareShop.shopName
				const user = uni.getStorageSync("userinfo")
				reqObject.path = `/subpkg/shops/shopEdit/shopEdit?shopId=${shopId}&promoter=${user.id}`
				reqObject.imageUrl = this.shareShop.shareUrl || this.shareShop.logoUrl
			}
			this.$refs.sharePopup.close();
			this.show = false;
			return reqObject
		},
	}
</script>

<style lang="scss">
.share-area {
		display: flex;
		flex-direction: column;
		align-items: center;
		background-color: #fff;
		padding: 10px;
		border-radius: 10px 10px 0 0;
	}

	.share-content {
		display: flex;
		flex-direction: row;
		justify-content: space-around;
		margin-bottom: 10px;
		width: 100%;
	}

	.share-item {
		display: flex;
		flex-direction: column;
		justify-content: space-around;
		align-items: center;
	}

	.share-btn {
		width: 80px;
		height: 60px;
		position: relative;
		background: none;
		margin-top: -60px;

		&::after {
			border: none;
		}
	}

	.share-cancel-area {
		width: 100%;
	}
</style>